<include file="Public:header" />
<include file="Public:left" />
	<form action="" method="post" enctype="multipart/form-data" id="brandForm">
     <section>
      <h2><strong>网站设置</strong></h2>
      <ul class="ulColumn2">
            <li>
            <span class="item_name" style="width:120px;">网站电话：</span>
            <input type="text" value="{$web_set_result['telephone']}" class="textbox textbox_295" name="telephone" id="telephone" placeholder="网站电话"/>
           </li>
          <li>
              <span class="item_name" style="width:120px;">网站logo: </span>
              <input type="file" class="textbox textbox_295" name="logo" id="logo"/>
              <image src="__STATIC__/uploads/{$web_set_result['logo']}" width="80">
          </li>
          <li>
              <span class="item_name" style="width:120px;">网站二维码: </span>
              <input type="file" class="textbox textbox_295" name="qr" id="qr"/>
              <image src="__STATIC__/uploads/{$web_set_result['qr']}" width="80">
          </li>
          <li>
            <span class="item_name" style="width:120px;">首页banner: </span>
            <input type="file" class="textbox textbox_295" name="banner" id="banner"/>
            <image src="__STATIC__/uploads/{$web_set_result['banner']}" width="80">
        </li>
       <li>
        <span class="item_name" style="width:120px;">新用户等级：</span>
        <select name="type">
            <option value="0">请选择用户等级</option>
            <volist name='member_authority' id="vo">
              <option value="{$vo.id}" <if condition="$vo.id eq $web_set_result['type']">selected='selected'</if>>{$vo.name}</option>
            </volist>
        </select>
       </li>
       <li>
        <span class="item_name" style="width:120px;"></span>
        <input type="button" class="link_btn" value="提交"/>
       </li>
      </ul>
     </section>
	 </form>
   <script>
      $(".link_btn").click(function(){
          var formData = new FormData();
          var telephone = $("input[name='telephone']").val();
          var type = $("select[name='type']").val();
          var file = $("input[name='logo']");
          var file2 = $("input[name='qr']");
          var file3 = $("input[name='banner']");
          var logo = file[0].files[0];
          var qr = file2[0].files[0];
          var banner = file3[0].files[0];

          formData.append('telephone',telephone);
          formData.append('logo',logo);
          formData.append('qr',qr);
          formData.append('banner',banner);
          formData.append('type',type);

          $.ajax({
                url:"{:url('Set/index')}",
                type:'POST',
                data:formData,
                async:false,
                processData:false,
                contentType:false,
                success:function(result){
                    if(result.code == '0'){
                        layer.alert(result.msg);
                    }else{
                        layer.alert(result.msg, {   
                            btn: ['确定']  
                        },  
                            function (index, item) { 
                            location.href = result.url;
                        });  
                    }
                }

            });
      });
   </script>
 </div>
</section>
</body>
</html>
